﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AppTrans
{
    class ReportCategoriesObject
    {
        public const string sql = @"
SELECT DictionaryTransactionTypes.Name as Тип,
       DictionaryCategories.Name  as Категория,
       Sum(Summa) as Сумма,
       DictionaryCurrency.Name as Валюта,
       DictionaryProject.Name as Проект
FROM Transactions
       inner join DictionaryTransactionTypes on Transactions.Type = DictionaryTransactionTypes.ID
       inner join DictionaryCategories on Transactions.Category = DictionaryCategories.ID
       inner join DictionaryProject on Transactions.Project = DictionaryProject.ID
       inner join DictionaryCurrency on Transactions.Currency = DictionaryCurrency.ID
GROUP BY DictionaryTransactionTypes.Name, DictionaryCategories.Name, DictionaryProject.Name, DictionaryCurrency.Name
ORDER BY DictionaryTransactionTypes.Name, DictionaryCategories.Name, DictionaryProject.Name, DictionaryCurrency.Name, Сумма
";

        public string Тип { get; set; }
        public string Категория { get; set; }
        public decimal? Сумма { get; set; }
        public string Валюта { get; set; }
        public string Проект { get; set; }
    }
}
